package xyz.zq.validation.service.impl;

import org.springframework.stereotype.Service;
import xyz.zq.validation.service.MyValidService;

@Service
public class MyValidServiceImpl implements MyValidService {

    @Override
    public boolean valid(Object value) {

        if (value instanceof Integer) {
            return 1 == (Integer) value;
        }

        if (value instanceof String) {
            return "1".equals(value.toString());
        }

        return false;
    }
}
